import request from '@/config/axios/appRequest'

export interface assetsVO extends PageParam {
  skuType?: string
}
export interface assetsActiveVO {
  id: number
  userId: number
  pauseReason?: string
}
// 获得支付订单
export function getOrder(id: number, sync?: boolean) {
  return request.get({
    url: '/pay/order/get',
    params: { id, sync }
  })
}
//【收银台】获得预支付订单详情和订单对应应用渠道下的支付订单信息列表
export function getAppChannelPayOrderList(data) {
  return request.post({
    url: '/pay/order/getAppChannelPayOrderList',
    data
  })
}
//【收银台】获取应用渠道下单笔支付状态接口
export function getSinglePayOrderStatus(data) {
  return request.post({
    url: '/pay/order/getSinglePayOrderStatus',
    data
  })
}
export function getSinglePayOrder(data) {
  return request.post({
    url: '/pay/order/getSinglePayOrder',
    data
  })
}
export function submitOrder(data) {
  return request.post({
    url: '/pay/order/offline-submit',
    data
  })
}

// 获得指定应用的开启的支付渠道编码列表
export function getOfflineEnableChannelSimpleList(appId) {
  return request.post({
    url: '/pay/channel/simple-list',
    data: { appId, sceneType: [1] }
  })
}

export function getAssetsList(params: assetsVO) {
  return request.get({
    url: '/pay/wallet/pageAssets',
    params
  })
}
export function getPayWalletPageCart(params: assetsVO) {
  return request.get({
    url: '/pay/wallet/pageCart',
    params
  })
}
export function getPayWalletPageCartDataMap(params: assetsVO) {
  return request.getOriginal({
    url: '/pay/wallet/pageCart',
    params
  })
}
export function assetsActive(params: assetsActiveVO) {
  return request.get({
    url: '/pay/wallet/active',
    params
  })
} //卡项激活
export function assetsStop(params: assetsActiveVO) {
  return request.get({
    url: '/pay/wallet/stop',
    params
  })
} //停卡
// 获得寄存-提货订单分页 订单类型，0 待寄存 1 待提货(已寄存) 2 已提货
export function orderReserveList(data: any) {
  return request.get({
    url: '/trade/order/get-rx-page',
    params: data
  })
}
export function orderReserveConfirm(data: any) {
  return request.post({
    url: '/pay/reserve/confirm',
    data: data
  })
}
export function getPayWalletPage(params: any) {
  return request.get({
    url: '/pay/wallet/page',
    params
  })
}
export function getWalletPage(params: any) {
  return request.get({
    url: '/pay/wallet/get-detail',
    params
  })
}

export function updateBalance(params: any) {
  return request.get({
    url: '/pay/wallet/updateBalance',
    params
  })
}
// 创建钱包充值记录（发起充值）
export function createWalletRecharge(data: any) {
  return request.post({
    url: '/pay/wallet-recharge/create',
    data
  })
}
// 获得钱包充值套餐列表
export function getWalletRechargePackageList() {
  return request.get({
    url: '/pay/wallet-recharge-package/list'
  })
}
// 获取资产详情
export function getWalletDetail(params: any) {
  return request.get({
    url: '/pay/wallet/get-detail',
    params
  })
}
